package com.hmall.common.client;

import com.hmall.common.dto.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@FeignClient( "userservice")
public interface AddressClient {

    //根据用户id查询地址列表
    @GetMapping("/address/uid/{userId}")
    List<Address> listUid(@PathVariable Long userId);

    //根据addressID查询地址
    @GetMapping("/address/{addressId}")
    Address listAddressId(@PathVariable Long addressId);

}
